
/**
 * @param {string} [mediatorName]
 * @param {Object} [viewComponent]
 * @constructor
 * @extends {Notifier}
 */
function Mediator (mediatorName, viewComponent)
{
	// TODO decide whether to enforce Mediators to have a name
	this.mediatorName= mediatorName || this.constructor.NAME;
	this.viewComponent= viewComponent;
	Notifier.call(this);
};

// subclass Notifier using NotifierAdapter
Mediator.prototype= new NotifierAdapter;
Mediator.prototype.constructor= Mediator;

/**
 * @static
 * @const
 * @type {string}
 */
Mediator.NAME= "Mediator";

/**
 * @return {string}
 */
Mediator.prototype.getMediatorName= function ()
{
	return this.mediatorName;
};

/**
 * @param {Object} viewComponent
 * @return {void}
 */
Mediator.prototype.setViewComponent= function (viewComponent)
{
	this.viewComponent= viewComponent;
};

/**
 * @return {Object|null|undefined}
 */
Mediator.prototype.getViewComponent= function ()
{
	return this.viewComponent;
};

/**
 * @return {Array.<string>}
 */
Mediator.prototype.listNotificationInterests= function ()
{
	return [];
};

/**
 * @param {Notification} notification
 * @return {void}
 */
Mediator.prototype.handleNotification= function (notification) { };

/**
 * @return {void}
 */
Mediator.prototype.onRegister= function () {};

/**
 * @return {void}
 */
Mediator.prototype.onRemove= function () {};

/**
 * @protected
 * @type {string}
 */
Mediator.prototype.mediatorName;

/**
 * @protected
 * @type {Object}
 */
Mediator.prototype.viewComponent= null;
